2b1d637509074b761d6ad060ff22df5e44660bb2,rivetz-test/src/main/java/com/rivetz/test/ECIESEnvelope.java,ECIESEnvelope,writeMbed,#,99
Before Change
outStream.write(ephemeralKey);
outStream.write(mbedSecond);
outStream.write(hmac);
outStream.write(mbedThird);
outStream.write(iv);
outStream.write(mbedFourth);
outStream.write(cryptText);
After Change
// Format is mbedFirst + ephemeral key + mbedSecond + hmac + mbedThird + iv + mbedFourth + cipherText
ArrayList<byte[]> output = new ArrayList<>();
output.add(cryptText);
output.add(asn1_length(cryptText.length));
output.add(new byte[] {0x04});
output.add(iv);
output.add(asn1_length(IV_LENGTH));
output.add(new byte[] {0x04});
output.add(mbedThird);
output.add(asn1_length(listLength(output)));
output.add(new byte[] {0x30});
output.add(hmac);